package com.pomr.service.sys;

import java.util.List;
import java.util.Map;

import com.pomr.model.health.PersonRecord;
import com.pomr.model.sys.Agency;
import com.pomr.model.sys.Role;
import com.pomr.model.sys.User;
import com.pomr.util.page.Page;

public interface UserService {
	
	/**
	 * 获取用户管理下的机构
	 * @return
	 * @throws Exception
	 */
	public List<Agency> findAgencysWithUser(User user) throws Exception;
	
	/**
	 * 检查uname的用户是否已存在
	 * @param uname
	 * @return
	 * @throws Exception
	 */
	public boolean testUser(String uname) throws Exception;
	
	/**
	 * 添加用户
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public boolean insertUser(User user) throws Exception;
	
	/**
	 * 获取用户管理下的角色
	 * @return
	 * @throws Exception
	 */
	public List<Role> findRolesWithUser(User user) throws Exception;
	
	/**
	 * 查询用户
	 * @return
	 * @throws Exception
	 */
	public Page<List<User>> findUsers(User user,String page) throws Exception;
	
	public Page<List<User>> findUsersInter(User user,Page<List<User>> page) throws Exception;
	
	public boolean deleteUsersInter(List<String> ids) throws Exception;
	
	public User serachUser(User user) throws Exception;
	
	public boolean editUser(User user) throws Exception;
	
	public boolean updatePwd(User user) throws Exception;
	
	public boolean editUserBase(User user) throws Exception;
	
	public boolean editUserStatus(User user) throws Exception;
	/**
	 * 获取机构下属可用用户
	 * @return
	 * @throws Exception
	 */
	public List<User> searchUsersOfAgency(User user) throws Exception;
	/**
	 * 获取机构下属可用用户
	 * @return
	 * @throws Exception
	 */
	public List<User> searchUsersByAgency(Agency agency) throws Exception;
	
	public Page<List<User>> findUsersByCond(String page,String limit,Map<String, String> map) throws Exception;
	

}
